package com.cakebackoffice.clientsoap.contract;


import org.ksoap2.serialization.NullSoapObject;
import org.ksoap2.serialization.SoapObject;

public class DeliveryType extends ContractObject {
    public int id;
    public String name;

    public DeliveryType() {
    }

    public DeliveryType(com.cakebackoffice.Model.DeliveryType deliveryType) {
        if (deliveryType.getRemoteID() != null)
            id = Integer.valueOf(deliveryType.getRemoteID().toString());
        name = deliveryType.getName();
    }


    @Override
    public void fill(SoapObject soapObject) {

        if (!(soapObject.getPropertySafely("id") instanceof NullSoapObject))
            this.id = Integer.parseInt(soapObject.getPropertySafelyAsString("id"));
        if (!(soapObject.getPropertySafely("idClient") instanceof NullSoapObject))
            this.name = soapObject.getPropertySafelyAsString("name");
    }
}
